package com.tdkj.action.backstage.information;

import java.util.List;
import javax.annotation.Resource;
import com.tdkj.action.BaseAction;
import com.tdkj.model.information.BeanAuditRule;
import com.tdkj.service.information.IBeanAuditRuleService;
public class AuditAction  extends BaseAction{
	private Long id;
	private BeanAuditRule bean;
	private IBeanAuditRuleService auditRuleService;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public BeanAuditRule getBean() {
		return bean;
	}
	public void setBean(BeanAuditRule bean) {
		this.bean = bean;
	}

	public IBeanAuditRuleService getAuditRuleService() {
		return auditRuleService;
	}

	@Resource
	public void setAuditRuleService(IBeanAuditRuleService auditRuleService) {
		this.auditRuleService = auditRuleService;
	}

	public String findAll(){
		return "findAll";
	}
	
	public String addAuditRule(){
		BeanAuditRule rule=auditRuleService.findById(1l, BeanAuditRule.class);
		if(rule==null){
			auditRuleService.save(rule);
		}else{
			rule=this.getBean();
			auditRuleService.merge(rule);
		}
		return findAll();
	}
}
